<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\ai\validate;

use think\Validate;

/**
 * 会员等级管理验证器
 */
class LevelValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'name' => 'require',
        'discount' => 'require',
        'task_number' => 'require',
        'day_number' => 'require',
        'price_base' => 'require',
        'price_day' => 'require',
        'price_week' => 'require',
        'price_mon' => 'require',
        'price_quarter' => 'require',
        'price_year' => 'require',
        'sort' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'name' => '等级名称必须填写',
        'discount' => '等级折扣必须填写',
        'task_number' => '同时任务数量必须填写',
        'day_number' => '每日任务上限必须填写',
        'price_base' => '基础价格必须填写',
        'price_day' => '日卡价格必须填写',
        'price_week' => '周卡价格必须填写',
        'price_mon' => '月卡价格必须填写',
        'price_quarter' => '季卡价格必须填写',
        'price_year' => '年卡价格必须填写',
        'sort' => '排序必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'name',
            'discount',
            'task_number',
            'day_number',
            'price_base',
            'price_day',
            'price_week',
            'price_mon',
            'price_quarter',
            'price_year',
            'sort',
        ],
        'update' => [
            'name',
            'discount',
            'task_number',
            'day_number',
            'price_base',
            'price_day',
            'price_week',
            'price_mon',
            'price_quarter',
            'price_year',
            'sort',
        ],
    ];

}
